package com.chijun.mform.process.dialog;

import android.content.Context;
import android.graphics.Color;
import android.view.Gravity;
import android.view.View;


import com.chijun.mform.R;

import com.chijun.mform.process.IHandlerLoadFormFull;
import com.chijun.mform.process.view.MainViewLoadProcessAllData;
import com.example.ccj.b.c.dialogxy.SYDialog;
import com.example.ccj.b.c.draw.TopBar;

public class OpenProcessView extends SYDialog.Builder {

    String formFullId;
    IHandlerLoadFormFull iHandlerLoadFormFull;

    public OpenProcessView(Context context, String formFullId, IHandlerLoadFormFull iHandlerLoadFormFull) {
        super(context);

        this.formFullId = formFullId;
        this.iHandlerLoadFormFull = iHandlerLoadFormFull;
        setDialogView(R.layout.dialog_open_process_view)
                .setCancelable(true)
                .setScreenHeightP(1.0F)
                .setScreenWidthP(1.0f)
                .setGravity(Gravity.BOTTOM)
                .setWindowBackground(Color.WHITE);

    }

    @Override
    public void initView(View layout) {
        TopBar topBar = layout.findViewById(R.id.dialog_view_ping_lun_top_bar);
        topBar.setLeftClick(v -> dismiss());

        MainViewLoadProcessAllData processAllData = layout.findViewById(R.id.dialog_open_process_view_main);
        processAllData.setFormFullId(formFullId,iHandlerLoadFormFull).setUploadOverListener(new MainViewLoadProcessAllData.IProcessViewApproveOver() {
            @Override
            public void onOver() {
                dismiss();
            }
        });
        processAllData.builder();

    }


}

